package com.entity;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

/**
 * 【财务管理】 - 贷款管理
 */

@Entity
@Table(name = "loan_info")
@Getter @Setter
public class FinanceLoanInfo extends BaseEntity {
    @Column(name = "company_name")
    private String companyName;

    //贷款银行名称
    @Column(name = "bank_name")
    private String bankName;

    //贷款金额
    @Column(name = "loan_amount")
    private BigDecimal loanAmount =  BigDecimal.ZERO;

    //利率
    @Column(name = "rate")
    private BigDecimal rate =  BigDecimal.ZERO;

    //每期利率
    @Column(name = "period_rate")
    private BigDecimal periodRate;

    //贷款到期日期
    @Column(name = "due_date")
    @Temporal(TemporalType.DATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date dueDate;

    //还款日期
    @Column(name = "interest_payment_date")
    @Temporal(TemporalType.DATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date interestPaymentDate;

    @Column(name = "status", columnDefinition = "TINYINT default 1")
    private Integer status;

    @Column(name = "remark", length = 500)
    private String remark;
}